from Eigenfaces import *
import numpy
import math

class Classifier:

	def __init__(self, eigenfaces, matrix, labels):
		self.eigenfaces = eigenfaces
		self.classifier = mdp.nodes.NearestMeanClassifier()
		self.classifier.train(eigenfaces.project(matrix), labels)
		self.classifier.stop_training()
	
	def classify(self, matrix):
		return self.classifier.label(self.eigenfaces.project(matrix))
